/**
 * \file
 *
 * \brief User board definition template
 *
 */

#ifndef USER_BOARD_H
#define USER_BOARD_H

#include <compiler.h>

/**
 * @defgroup atxmega128a1_xpld_config XMEGA-A1 Xplained Board Configuration
 * @{
 */

//! \name Miscellaneous data
//@{
//@}

//! Number of LEDs.
#define LED_COUNT                        4

//! \name GPIO Connections
//@{
#define LED0_GPIO						IOPORT_CREATE_PIN(PORTA, 4)
#define LED1_GPIO						IOPORT_CREATE_PIN(PORTA, 5)
#define LED2_GPIO						IOPORT_CREATE_PIN(PORTA, 6)
#define LED3_GPIO						IOPORT_CREATE_PIN(PORTA, 7)

#define LED0_RED						LED0_GPIO
#define LED1_GREEN						LED1_GPIO
#define LED2_RED						LED2_GPIO
#define LED3_GREEN						LED3_GPIO

#define DIP_SW1							IOPORT_CREATE_PIN(PORTE, 2)
#define DIP_SW2							IOPORT_CREATE_PIN(PORTE, 3)

//@}

//! \name GPIO Connections of devices Reset pins
//@{
	
#define RESET_INPUT_FPGA				IOPORT_CREATE_PIN(PORTB, 3)
#define RESET_LEFT_OUT_FPGA				IOPORT_CREATE_PIN(PORTB, 1)
#define RESET_RIGHT_OUT_FPGA			IOPORT_CREATE_PIN(PORTB, 2)
#define RESET_HDMI_RX					IOPORT_CREATE_PIN(PORTC, 4)
#define RESET_LEFT_W2					IOPORT_CREATE_PIN(PORTD, 6)
#define RESET_RIGHT_W2					IOPORT_CREATE_PIN(PORTD, 7)

#define PWDN_LEFT_DVI					IOPORT_CREATE_PIN(PORTD, 5)
#define PWDN_RIGHT_DVI					IOPORT_CREATE_PIN(PORTD, 4)

//@}

//! \name ADC Connection of the OLED VGN
//@{

#define OLED_LEFT_ADC_INPUT				ADCCH_POS_PIN0
#define OLED_RIGHT_ADC_INPUT			ADCCH_POS_PIN1

//@}


/*! \name USARTs
 */
//! @{
	
#define UART_CONSOLE					&USARTC0
#define UART_WCU						&USARTD0

//! @}

/*! \name Devices I2C Address
 */
//! @{
	
#define I2C_OLED_RIGHT					0x4C
#define I2C_OLED_LEFT					0x4E
#define I2C_W2_RIGHT					0xDC
#define I2C_W2_LEFT						0xDA
#define I2C_HDMI_0						0x98
#define I2C_HDMI_1						0x9A
#define I2C_EEPROM						0xA0
#define I2C_CODEC						0x8C
#define I2C_FPGA_OUT_RIGHT				0x50
#define I2C_FPGA_OUT_LEFT				0x52
#define I2C_FPGA_IN						0x54
#define I2C_DVI_RIGHT					0x72
#define I2C_DVI_LEFT					0x7A


//! @}


#endif // USER_BOARD_H
